class MilestonesController < ApplicationController

  def index
    project_id = request.raw_post.to_i
    b = BasecampWrapper.create_wrapper
    b.connect!(current_user.account)
    
    begin
      @milestones = b.milestones(project_id).map { |m| [m.title, m.id] }
    rescue
      @milestones = b.milestones(params[:project_id].to_i).map { |m| [m.title, m.id] }
    end
  end
end
